$OpenBSD: patch-src_os_unix_pa_unix_util_c,v 1.2 2013/03/12 00:59:50 brad Exp $
--- src/os/unix/pa_unix_util.c.orig	Thu Jul  5 23:44:45 2012
+++ src/os/unix/pa_unix_util.c	Thu Jul  5 23:49:33 2012
@@ -251,6 +251,7 @@ static PaError BoostPriority( PaUnixThread* self )
 
     assert( self );
 
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULINGG) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0)
     if( pthread_setschedparam( self->thread, SCHED_FIFO, &spm ) != 0 )
     {
         PA_UNLESS( errno == EPERM, paInternalError );  /* Lack permission to raise priority */
@@ -261,6 +262,7 @@ static PaError BoostPriority( PaUnixThread* self )
     {
         result = 1; /* Success */
     }
+#endif
 error:
     return result;
 }
@@ -299,8 +301,10 @@ PaError PaUnixThread_New( PaUnixThread* self, void* (*
 #endif
 
     PA_UNLESS( !pthread_attr_init( &attr ), paInternalError );
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0)
     /* Priority relative to other processes */
     PA_UNLESS( !pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ), paInternalError );   
+#endif
 
     PA_UNLESS( !pthread_create( &self->thread, &attr, threadFunc, threadArg ), paInternalError );
     started = 1;
@@ -347,7 +351,9 @@ PaError PaUnixThread_New( PaUnixThread* self, void* (*
         {
             int policy;
             struct sched_param spm;
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0)
             pthread_getschedparam(self->thread, &policy, &spm);
+#endif
         }
     }
     
